<HTML><HEAD><TITLE>?X &= ?Y</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(sd)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>?X &= ?Y</H1>
X is the same atomic value as Y
<DL>
<DT><EM>X</EM></DT>
<DD>Variable or atomic value
</DD>
<DT><EM>Y</EM></DT>
<DD>Variable or atomic value
</DD>
</DL>
<H2>Description</H2>

	Constrains X and Y to be the same.  This is very similar to unifying
	X and Y, except in the case where X and Y are both variables. While
	unification turns the two variables into one, this constraint preserves
	the separate variables but constrains them to be equal.

<H2>Examples</H2>
<PRE>
    ?- X &amp;:: [red,green,blue], X &amp;= red.
    X = red
    Yes (0.00s cpu)

    ?- X &amp;:: [red,green,blue], X &amp;= yellow.
    No (0.00s cpu)

    ?- [X, Y] &amp;:: [red,green,blue], X &amp;= Y.
    X = X{[blue, green, red]}
    Y = Y{[blue, green, red]}
    There is 1 delayed goal.
    Yes (0.00s cpu)

    ?- X &amp;:: [red,green,blue], X &amp;= Y.
    X = X{[blue, green, red]}
    Y = Y{[blue, green, red]}
    There is 1 delayed goal.
    Yes (0.00s cpu)

    ?- X &amp;:: [red,green,blue], Y &amp;:: [blue,yellow,green], X &amp;= Y.
    X = X{[blue, green]}
    Y = Y{[blue, green]}
    There is 1 delayed goal.
    Yes (0.00s cpu)

    ?- X &amp;:: [red, green, blue], Y &amp;:: [blue, yellow, brown], X &amp;= Y.
    X = blue
    Y = blue
    Yes (0.00s cpu)

    ?- red &amp;= red.
    Yes (0.00s cpu)

    ?- X &amp;= red.
    X = red
    Yes (0.00s cpu)
    </PRE>
<H2>See Also</H2>
<A HREF="../../lib/sd/YE-3.html">&= / 3</A>, <A HREF="../../lib/sd/YRE-2.html">&\= / 2</A>
</BODY></HTML>
